/**
 * @file mat_funs.h
 *
 *  Created on: Mar 29, 2010
 *   Author: Marco Luisi
 */

#ifndef MAT_FUNS_H_
#define MAT_FUNS_H_

#define NAMELEN 8 //forse non serve qui
#define MAX_INT_STRING 10 //da INT_MAX, spostare in client parse?

typedef struct {
	int rows;
	int columns;
	int saved;
	char *name;
	double **mat;
} matrix_t;

typedef struct {
	matrix_t *matrix;
	struct matrix_l * next;

}matrix_l; //meglio cambiare nome?

typedef struct matrix_t MAT;
typedef MAT *MLINK;

typedef double ** matrix;
typedef double * row;
typedef double elem;


///allocazione blocco matrice
matrix* allocateMat(int,int);

///funzioni su matrice
int add(matrix_t *,matrix_t *,matrix_t *);
int sub(matrix_t *,matrix_t *,matrix_t *);
int mul(matrix_t *,matrix_t *,matrix_t *);
int trasp(matrix_t *,matrix_t *);


///funzioni di utilità
void printMat(matrix_t *);
int addMat(matrix_l **, matrix_t *);
matrix_t* newMat(char*,int,int, double**);
void listMat(matrix_l *);

#endif /* MAT_FUNS_H_ */
